package cn.doitedu.basic.jdk;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

/**
 * Created by Administrator on 2021/10/1.
 */
public class ThisDemo {

    private void  printValur(String str){
        System.out.println("print value : "+str);
    }

    public void test(){
        List<String> al = Arrays.asList("a", "b", "c", "d");
        Consumer<String> printValur = this::printValur;
        //al.forEach(x->printValur.accept(x));
        al.forEach(printValur);
    }

    public static void main(String[] args) {
        ThisDemo thisDemo = new ThisDemo();
        thisDemo.test();
    }
}
